package com.dgut.hisystem.controller;

import com.dgut.hisystem.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mail")
public class MailController {
    @Autowired
    private MailService mailService;

    @RequestMapping(value = "/send", method = RequestMethod.GET)
    public String sendMail(@RequestParam(value = "userName")String userName){
        mailService.sendSimpleMail(userName);
        return "success";
    }
}
